Skip to content

add missing indexes on VerificationToken table#20040

Merged
krrishdholakia merged 1 commit intoBerriAI:litellm_oss_staging_01_31_2026from
CAFxX:cafxx-verificationtoken-indexes
Jan 31, 2026
Merged

add missing indexes on VerificationToken table#20040
krrishdholakia merged 1 commit intoBerriAI:litellm_oss_staging_01_31_2026from
CAFxX:cafxx-verificationtoken-indexes

Conversation

@CAFxX
Copy link
Contributor

@CAFxX CAFxX commented Jan 30, 2026

On our infrastructure the queries mentioned in the comments in schema.prisma all cause full table scans because the only index is the primary key. As our verificationtoken table is pretty big, those queries have high latency (>100ms) and frequently cause significant CPU utilization spikes, disrupting all other database traffic.

Before creation of the indexes (not during a spike)

image

After creation of the indexes

image

Note how the SELECTs become a 1~2 orders of magnitude faster.

This is my first PR involving changes to the schema, so please let me know if the process is correct.

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🐛 Bug Fix
🚄 Infrastructure

Changes

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Error Error Jan 30, 2026 8:05am

Request Review

Copy link
Contributor

@JehandadK JehandadK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CAFxX !

@ishaan-jaff Can we move it to CI Testing? Thanks!

@CAFxX CAFxX force-pushed the cafxx-verificationtoken-indexes branch from 5442dc6 to 3c8150e Compare January 30, 2026 08:03
@krrishdholakia krrishdholakia changed the base branch from main to litellm_oss_staging_01_31_2026 January 31, 2026 23:05
@krrishdholakia krrishdholakia merged commit 3880eb0 into BerriAI:litellm_oss_staging_01_31_2026 Jan 31, 2026
4 of 8 checks passed
Sameerlite added a commit that referenced this pull request Feb 3, 2026
Sameerlite added a commit that referenced this pull request Feb 3, 2026
@greptile-apps greptile-apps bot mentioned this pull request Feb 3, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants